﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Controls;
using System.Windows;
using BaseTypesControlLib.Interfaces;

namespace BaseTypesControlLib.Controls
{
    public class ManagerPanel : Panel, IUseAllWidth, IUseAllHeight
    {
        //protected const int MAX_SIZE = 0x3FFFFFFF;//BB max value
        protected const int MAX_SIZE = 0x3FFFF;

        static ManagerPanel()
        {
            FrameworkPropertyMetadata fpm = new FrameworkPropertyMetadata(false,
                FrameworkPropertyMetadataOptions.AffectsMeasure |
                FrameworkPropertyMetadataOptions.AffectsArrange);
            UseAllWidthProperty = DependencyProperty.Register("UseAllWidth", typeof(bool),
                typeof(ManagerPanel), fpm);

            fpm = new FrameworkPropertyMetadata(false,
                FrameworkPropertyMetadataOptions.AffectsMeasure |
                FrameworkPropertyMetadataOptions.AffectsArrange);
            UseAllHeightProperty = DependencyProperty.Register("UseAllHeight", typeof(bool),
                typeof(ManagerPanel), fpm);

            fpm = new FrameworkPropertyMetadata(false,
                FrameworkPropertyMetadataOptions.AffectsMeasure |
                FrameworkPropertyMetadataOptions.AffectsArrange);
            VerticalScrollProperty = DependencyProperty.Register("VerticalScroll", typeof(bool),
                typeof(ManagerPanel), fpm);

            fpm = new FrameworkPropertyMetadata(false,
                FrameworkPropertyMetadataOptions.AffectsMeasure |
                FrameworkPropertyMetadataOptions.AffectsArrange);
            HorizontalScrollProperty = DependencyProperty.Register("HorizontalScroll", typeof(bool),
                typeof(ManagerPanel), fpm);
        }

        public bool UseAllWidth
        {
            get { return (bool)GetValue(UseAllWidthProperty); }
            set { SetValue(UseAllWidthProperty, value); }
        }

        public static readonly DependencyProperty UseAllWidthProperty;

        public bool UseAllHeight
        {
            get { return (bool)GetValue(UseAllHeightProperty); }
            set { SetValue(UseAllHeightProperty, value); }
        }

        public static readonly DependencyProperty UseAllHeightProperty;

        public bool VerticalScroll
        {
            get { return (bool)GetValue(VerticalScrollProperty); }
            set { SetValue(VerticalScrollProperty, value); }
        }

        public static readonly DependencyProperty VerticalScrollProperty;

        public bool HorizontalScroll
        {
            get { return (bool)GetValue(HorizontalScrollProperty); }
            set { SetValue(HorizontalScrollProperty, value); }
        }

        public static readonly DependencyProperty HorizontalScrollProperty;
    }
}
